package net.cherrylab.tools
{
	public class DiceMachine
	{
		
		public static const DICE_FOUR:int = 4;    
		public static const DICE_SIX:int = 6;    
		public static const DICE_EIGHT:int = 8;    
		public static const DICE_TEN:int = 10;    
		public static const DICE_TWELVE:int =12;    
		public static const DICE_TWENTY:int =20;    
		public static const DICE_HUNDRED:int = 100;    
		
		public function DiceMachine()
		{
		}
		
		/**
		 * 投掷一个骰子
		 * */
		public static function Dice(n:int):int
		{
			var num:int;
			num=Math.random()*n*10;
			return num;
		}
		
		/**
		 * 投掷几个一样的骰子
		 * */
		public static function SeveralDices(n:int,m:int=1):int
		{
			var num:int=0;
			var i:int;
			for(i=0;i<m;++i)
			{
				num+=Math.random()*n*10;
			}
			
			return num;
		}
	}
}